home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS075.dsk
/
CONNECTION.int
< prev
next >
Wrap
Text File
|
2012-02-16
|
6KB
|
165 lines
5 DIM N1$(7),N2$(7)
10 GOSUB 32000
20 GOSUB 30000
30 GOSUB 29000
40 GOSUB 28000:REM SET-UP
50 GOSUB 27000:REM NAMES & SCORE
100 GOSUB 378
110 COLOR= 0:GOSUB 200
120 PAD=(PDL (NAME-1)/4)
140 X= PEEK (768+PAD MOD 7)
150 Y= PEEK (768+PAD/7)
155 IF PAD>=56 THEN X=35
156 IF PAD>=56 THEN Y=39
157 IF FLAG=1 AND SCRN(X+1,Y)>0 THEN 120
158 IF FLAG=2 AND SCRN(Y,X+1)>0 THEN 120
160 COLOR= NAME:GOSUB 200
170 IF PEEK (NAME-16288)>127 THEN GOSUB 300
175 IF S1+S2=49 THEN 21000
180 GOTO 110
200 IF FLAG=1 THEN HLIN X+1,X+4 AT Y
210 IF FLAG=2 THEN VLIN X+1,X+4 AT Y
220 RETURN
300 FOR WAIT=1 TO 100:NEXT WAIT
302 IF PAD<56 THEN 350
305 IF FLAG=1 THEN 330
310 IF FLAG=2 THEN 340
320 RETURN
330 FLAG=2:RETURN
340 FLAG=1:RETURN
350 REM
360 COLOR= 13:GOSUB 200
365 COLOR= NAME:GOSUB 400
370 X=35:Y=39:GOSUB 200
372 IF NAME=1 THEN 376
374 IF NAME=2 THEN 378
376 NAME=2:VTAB 23:TAB 13-(10+ LEN(N2$))/2:PRINT " OK ";N2$;"'S TURN ";:RETURN
378 NAME=1:VTAB 23:TAB 17-(10+ LEN(N1$))/2:PRINT " YOUR TURN ";N1$;" ";:RETURN
380 RETURN
400 REM CHECK FOR BOX
405 IF FLAG=1 AND Y=36 OR FLAG=1 AND Y>2 THEN GOSUB 435
410 IF FLAG=1 AND Y<36 OR FLAG=1 AND Y=2 THEN GOSUB 430
415 IF FLAG=2 AND Y<36 OR FLAG=2 AND Y=2 THEN GOSUB 440
420 IF FLAG=2 AND Y=36 OR FLAG=2 AND Y>2 THEN GOSUB 445
425 RETURN
430 IF SCRN(X+1,Y+5)>0 AND SCRN(X,Y+1)>0 AND SCRN(X+5,Y+1)>0 THEN GOSUB 510:RETURN
435 IF SCRN(X+1,Y-5)>0 AND SCRN(X,Y-1)>0 AND SCRN(X+5,Y-1)>0 AND SCRN(X+1,Y)>0 THEN GOSUB 520:RETURN
440 IF SCRN(Y+1,X+5)>0 AND SCRN(Y,X+1)>0 AND SCRN(Y+5,X+1)>0 AND SCRN(Y+1,X)>0 THEN GOSUB 530:RETURN
445 IF SCRN(Y-1,X+5)>0 AND SCRN(Y,X+1)>0 AND SCRN(Y-5,X+1)>0 AND SCRN(Y-1,X)>0 THEN GOSUB 540:RETURN
450 RETURN
510 HLIN X+2,X+3 AT Y+2:HLIN X+2,X+3 AT Y+3:GOSUB 600:RETURN
520 HLIN X+2,X+3 AT Y-2:HLIN X+2,X+3 AT Y-3:GOSUB 600:RETURN
530 VLIN X+2,X+3 AT Y+2:VLIN X+2,X+3 AT Y+3:GOSUB 600:RETURN
540 VLIN X+2,X+3 AT Y-2:VLIN X+2,X+3 AT Y-3:GOSUB 600:RETURN
590 RETURN
600 REM A MATCH
610 VTAB 21:IF NAME=1 THEN TAB LEN(N1$)+4:IF NAME=2 THEN TAB 33: POKE 50,127:PRINT "BOX!!"
615 FOR WAIT=1 TO 50:SOUND= PEEK (-16336):NEXT WAIT
620 POKE 50,255
630 IF NAME=1 THEN 660
640 S2=S2+1:NAME=1
650 VTAB 21:TAB 30:PRINT "'S SCORE=";S2:RETURN
660 S1=S1+1:NAME=2
670 VTAB 21:TAB 1:PRINT N1$;"'S SCORE=";S1:RETURN
2907 POKE 34,23
5330 VTAB 23:TAB 17:PRINT "OK ";:TAB 20
5340 IF NAME=1 THEN PRINT N1$;
5350 IF NAME=2 THEN PRINT N2$;
5355 VTAB 24:TAB 11:PRINT " CHOOSE A CARD ";
5440 IF NAME=1 THEN 5460
5450 IF NAME=2 THEN 5470
5460 NAME=2:GOTO 300
5470 NAME=1:GOTO 300
5499 REM
5500 REM A MATCH
5510 VTAB 21:IF NAME=1 THEN TAB LEN(N1$)+4:IF NAME=2 THEN TAB 33: POKE 50,127:PRINT "MATCH"
5550 POKE 50,255
5600 REM CHANGE SCORE
5610 IF NAME=1 THEN 5650
5620 S2=S2+1
5640 VTAB 21:TAB 30:PRINT "'S SCORE=";S2:GOTO 300
5650 S1=S1+1
5660 VTAB 21:TAB 1:PRINT N1$;"'S SCORE=";S1:GOTO 300
5670 END
21000 REM GAME WINNER
21010 TEXT :CALL HOME:VTAB 10:TAB 15
21020 IF S1>S2 THEN PRINT N1$;" WINS<CTRL-G><CTRL-G><CTRL-G><CTRL-G>"
21030 IF S2>S1 THEN PRINT N2$;" WINS<CTRL-G><CTRL-G><CTRL-G><CTRL-G><CTRL-G>"
21040 IF S1=S2 THEN PRINT "TIE GAME<CTRL-G><CTRL-G><CTRL-G><CTRL-G>"
21050 VTAB 21:INPUT "DO YOU WANT TO PLAY AGAIN? (Y/N)",A$
21060 IF A$="Y" OR A$="YES" THEN
21070 IF A$="N" OR A$="NO" THEN END
21080 GOTO 21050
21099 REM
27000 REM WRITE NAMES & SCORE
27010 CALL HOME
27020 VTAB 21:TAB 1:PRINT N1$;"'S SCORE=";S1;
27030 VTAB 21:TAB 30- LEN(N2$):PRINT N2$;"'S SCORE=";S2;
27040 POKE 34,23
27050 VTAB 23:TAB 1:PRINT N1$;" YOUR RED";:TAB 31- LEN(N2$):PRINT N2$;" YOUR BLUE"
27055 FOR WAIT=1 TO 500:NEXT WAIT
27056 VTAB 23:PRINT " "
27060 RETURN
27070 REM
28000 REM SETUP
28010 GR :COLOR= 15
28020 FOR I=0 TO 63
28030 X= PEEK (768+I MOD 8)
28040 Y= PEEK (768+I/8)
28050 PLOT X,Y
28060 NEXT I
28070 RETURN
28080 REM
29000 REM PLAYERS NAMES
29010 CALL HOME
29020 VTAB 21:PRINT "TYPE NAME OF 1ST PLAYER? ....... <RTN>";: POKE 36,25:INPUT N1$
29030 VTAB 23:PRINT "TYPE 2ND PLAYER'S NAME? ....... <RTN>";: POKE 36,24:INPUT N2$
29035 RETURN
29080 RETURN
29099 REM
30000 REM INTRODUCTION
30010 CALL HOME:VTAB 10:TAB 12:PRINT "* CONNECTION *"
30020 TAB 18:PRINT "BY"
30030 TAB 12:PRINT "MICHAEL BRYAN"
30040 VTAB 24:INPUT "INSTRUCTIONS (Y/N)",N1$:IF N1$="N" OR N1$="NO" THEN RETURN
30050 IF N1$#"Y" THEN 30040
30099 REM
31000 REM INSTUCTIONS
31010 CALL HOME:VTAB 2:TAB 13:PRINT "INSTRUCTIONS":VTAB 5
31030 PRINT "USE THE PADDLES TO POSITION YOUR LINE "
31040 PRINT "BETWEEN TWO WHITE DOTS. PRESS THE BUTTON"
31050 PRINT "WHEN YOU HAVE MADE YOUR SELECTION. "
31060 PRINT "IF YOU WANT TO CHANGE FROM HORIZONTAL "
31070 PRINT "TO VETICAL OR VICE VERSA -PRESS "
31080 PRINT "THE PADDLE BUTTON WHEN THE BAR IS IN THE"
31090 PRINT "LOWER RIGHT HAND CORNER"
31100 POKE 50,63:VTAB 24:TAB 10:PRINT "HIT ANY KEY TO PLAY"
31110 IF PEEK (-16384)<128 THEN 31110
31120 POKE -16368,0: POKE 50,255:RETURN
31199 REM
32000 REM PRGM CONSTANTS
32010 NAME=1:FLAG=1:HOME=-936
32020 POKE 768,2: POKE 769,7: POKE 770,12: POKE 771,17: POKE 772,22: POKE 773,27: POKE 774,32: POKE 775,37
32090 RETURN
32099 REM
32700 REM *** MAIN PROGRAM ***
32701 REM 100-PRINT DECK
32702 REM 200-WRITE NAMES & SCORE
32703 REM 300-PICK A NUMBER
32704 REM 400-NO MATCH
32705 REM 500-MATCH
32706 REM 600-UPDATE SCORE
32709 REM
32710 REM *** SUBROUTINES ***
32720 REM 21000-GAME WINNER
32721 REM 27000-WRITE NAMES & SCORE
32722 REM 28000-SET-UP GAME BOARD
32723 REM 29000-PLAYER'S NAMES
32724 REM 30000-INTRODUCTION
32725 REM 31000-INSTRUCTIONS
32726 REM 32000-PRGM CONSTANTS